<template>
  <div class="card">
    <moduleHead title="案件办理信息"></moduleHead>
    <el-form class="key-value" label-width="130px" v-if="details.workOrderHandleInfo">
      <el-row :gutter="20">
        <el-col :span="8">
          <el-form-item label="案件编号：">
            {{ details.workOrderHandleInfo.workOrderNumber }}
          </el-form-item>
        </el-col>
        <el-col :span="8">
          <el-form-item label="案件状态：">
            <template v-if="details.workOrderHandleInfo.status === '5'">
              <span v-if="details.appraiseStatus === 'N'">待评价</span>
              <span v-else>已办结</span>
            </template>
            <span v-else>{{ workOrderStatusDict[details.workOrderHandleInfo.status] }}</span>
            <!-- <span v-if="details.workOrderHandleInfo.status === '0'">待受理</span>
            <span v-if="details.workOrderHandleInfo.status === '1'">回退中</span>
            <span v-if="details.workOrderHandleInfo.status === '2'">待确认</span>
            <span v-if="details.workOrderHandleInfo.status === '3'">调查中</span>
            <span v-if="details.workOrderHandleInfo.status === '4'">待办结</span>
            <template v-if="details.workOrderHandleInfo.status === '5'">
              <span v-if="details.workOrderHandleInfo.appraiseStatus === 'N'">待评价</span>
              <span v-else>已办结</span>
            </template>
            <span v-if="details.workOrderHandleInfo.status === '6'">不受理</span>
            <span v-if="details.workOrderHandleInfo.status === '7'">已中止</span>
            <span v-if="details.workOrderHandleInfo.status === '8'">已终止</span>
            <span v-if="details.workOrderHandleInfo.status === '9'">撤回中</span>
            <span v-if="details.workOrderHandleInfo.status === '10'">已撤回</span>
            <span v-if="details.workOrderHandleInfo.status === '11'">已移交</span>
            <span v-if="details.workOrderHandleInfo.status === '12'">预审中</span>
            <span v-if="details.workOrderHandleInfo.status === '13'">已退回</span>
            <span v-if="details.workOrderHandleInfo.status === '14'">放弃投诉举报</span> -->
          </el-form-item>
        </el-col>
        <el-col :span="8">
          <el-form-item label="案件来源：">
            <!-- {{ details.workOrderHandleInfo.itemSource === 0 ? "网站" : details.workOrderHandleInfo.itemSource === 2 ? "手动录入" : "导入" }} -->
            {{ details.workOrderHandleInfo.itemSource | workOrderEventSource }}
            <!-- 0网站1-12345导入2手动录入 -->
          </el-form-item>
        </el-col>
      </el-row>
      <el-row :gutter="20">
        <el-col :span="8">
          <el-form-item label="受理单位：">
            {{ details.workOrderHandleInfo.acceptDepartmentName }}
          </el-form-item>
        </el-col>
        <el-col :span="8">
          <el-form-item label="承办单位：">
            {{ details.workOrderHandleInfo.processDepartmentName || "-" }}
          </el-form-item>
        </el-col>
        <el-col :span="8">
          <el-form-item label="案件归属地：">
            {{ details.workOrderHandleInfo.ownershipCase }}
          </el-form-item>
        </el-col>
      </el-row>
      <el-row :gutter="20">
        <el-col :span="8">
          <el-form-item label="督办案件：">
            {{ details.workOrderHandleInfo.supervisionCases }}
          </el-form-item>
        </el-col>
        <el-col :span="8">
          <el-form-item label="督办单位：">
            {{ details.workOrderHandleInfo.supervisionDepartmentName }}
          </el-form-item>
        </el-col>
        <el-col :span="8"></el-col>
      </el-row>
      <el-row :gutter="20">
        <el-col :span="24">
          <el-form-item label="推送单位：">
            {{ departmentName(details.pushDepartmentList) }}
          </el-form-item>
        </el-col>
      </el-row>
      <el-row :gutter="20">
        <el-col :span="24">
          <el-form-item label="抄送单位：">
            {{ departmentName(details.copyDepartmentList) }}
          </el-form-item>
        </el-col>
      </el-row>
      <el-row :gutter="20">
        <el-col :span="8">
          <el-form-item label="提交时间：">
            {{ details.createTime }}
          </el-form-item>
        </el-col>
        <el-col :span="8">
          <el-form-item label="受理时间：">
            {{ details.filingTime }}
          </el-form-item>
        </el-col>
        <el-col :span="8">
          <el-form-item label="结案时间：">
            {{ details.finishTime }}
          </el-form-item>
        </el-col>
      </el-row>
      <el-row :gutter="20">
        <el-col :span="24">
          <el-form-item v-if="details.workOrderHandleInfo && details.workOrderHandleInfo.acceptAttachmentList" label="佐证材料："></el-form-item>
          <el-form-item v-if="details.workOrderHandleInfo && details.workOrderHandleInfo.acceptAttachmentList" label="" label-width="0">
            <upload-preview :file-list="details.workOrderHandleInfo" :showDel="false" btnType="text"></upload-preview>
          </el-form-item>
        </el-col>
      </el-row>
    </el-form>
  </div>
</template>

<script>
import UploadPreview from "@/components/uploadInput/uploadPreview.vue";
import { workOrderStatusDict } from "@/utils/dict";
import { workOrderEventSource } from "@/utils/filters";
export default {
  name: "CaseHandling",
  components: { UploadPreview },
  filters: {
    workOrderEventSource,
  },
  props: {
    details: {
      type: Object,
      default: () => {},
    },
  },
  data() {
    return { workOrderStatusDict: workOrderStatusDict };
  },
  computed: {
    departmentName() {
      return (data) => {
        return data.map((item) => item.departmentName).join("、");
      };
    },
  },
  watch: {},

  created() {},
  methods: {},
};
</script>
<style lang="less" scoped>
.el-form-item__content {
  div {
    word-break: break-all;
  }
}
</style>
